<template>
  <div class="main-header">
    <div class="header-left">
      <el-icon><Fold /></el-icon>
      <el-icon><Expand /></el-icon>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/' }">Dashboard</el-breadcrumb-item>
        <!-- <el-breadcrumb-item>
          <a href="/">promotion management</a>
        </el-breadcrumb-item> -->
        <el-breadcrumb-item>员工</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="header-right">
      <el-avatar :size="default" :src="userInfo.staffPhoto" />
      <el-dropdown>
        <span class="text"> {{ userInfo.username }} </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>Action 1</el-dropdown-item>
            <el-dropdown-item>Action 2</el-dropdown-item>
            <el-dropdown-item>Action 3</el-dropdown-item>
            <el-dropdown-item divided>退出登录</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
      <el-icon><Setting /></el-icon>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { useUserStoreHook } from "@/store/modules/user/index";
import { storeToRefs } from "pinia";
import { onMounted } from "vue";
const userStore = useUserStoreHook();
onMounted(() => {
  userStore.GetUserDataAction();
});
const { userInfo } = storeToRefs(userStore);
</script>
<style scoped>
.main-header {
  display: flex;
  justify-content: space-between;
  height: 50px;
  align-items: center;
}
.header-left {
  display: flex;
  align-items: center;
}
.header-right {
  display: flex;
  align-items: center;
  .text {
    font-size: 17px;
  }
}
.el-dropdown {
  margin-left: 15px;
  margin-right: 15px;
}
</style>
